<!DOCTYPE html>
<html>
<head>
    <title>门店产品阶梯价</title>
		<#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <el-container>
            <el-aside>
                <el-tree :data="storeCategoryTree"  @node-click="treeClick"></el-tree>
            </el-aside>
            <el-main>
                <!--<div>-->
                    <!--<input @click="choiceTree" value="点击选择门店分类">-->
                <!--</div>-->
                    (*温馨提示:双击查看产品阶梯价)
                    <template>
                        <form class="form-inline" role="form">
                            <!--<el-input v-model="queryName" style="width:150px;"  placeholder="请输入产品名称"></el-input>-->
                            <!--<el-button @click="search" type="small">查询</el-button>-->
                            <div class="form-group">
                                <input type="text" class="form-control input-sm" v-model="queryName" placeholder="请输入产品名称">
                            </div>&nbsp;&nbsp;&nbsp;
                            <a class="btn btn-default btn-sm" @click="search"><i class="fa fa-search"></i>&nbsp;查询</a>
                        </form>
                        <el-table :data="storeGoodsProductEntityList" style="width: 100%" @row-dblclick="loadStepPrice">
                            <el-table-column prop="productId" label="产品id" width="180"></el-table-column>
                            <el-table-column prop="productName" label="产品名称" width="180"></el-table-column>
                            <el-table-column prop="goodsType" label="商品类型" width="100">
                                <template slot-scope="scope">
                                    <span v-if="scope.row.goodsType == 'standard'">标准商品</span>
                                    <span v-if="scope.row.goodsType == 'print'">商务印刷</span>
                                    <span v-if="scope.row.goodsType == 'fast'">数码快印</span>
                                    <span v-if="scope.row.goodsType == 'material'">广告物料</span>
                                    <span v-if="scope.row.goodsType == 'copy'">复印纸</span>
                                    <span v-if="scope.row.goodsType == 'paper'">大纸商品</span>
                                    <span v-if="scope.row.goodsType == 'design'">设计商品</span>
                                    <!--<el-input v-if="scope.row.goodsType == 'standard'">标准商品</el-input>-->
                                </template>
                            </el-table-column>
                            <el-table-column prop="weight" label="重量" width="180"></el-table-column>
                            <el-table-column prop="unit" label="单位" width="180"></el-table-column>
                            <el-table-column prop="craft" label="规格属性" width="300"></el-table-column>
                            <el-table-column prop="storePrice" label="单价" width="180"></el-table-column>
                            <el-table-column label="操作" width="180">
                                <template slot-scope="scope">
                                    <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">价格编辑</el-button>
                                    <!--<el-button size="mini" @click="editStepPrice(scope.$index, scope.row)">阶梯价</el-button>-->
                                </template>
                            </el-table-column>
                        </el-table>
                    </template>
                    <template v-if="stepPriceListView != null">
                        <el-table :data="stepPriceListView" width="90%" stripe  style="width: 100%">
                            <el-table-column prop="minSum"  label="起始数量" width="180"></el-table-column>
                            <el-table-column prop="maxSum" label="结束数量" width="180"></el-table-column>
                            <el-table-column prop="price" label="价格" width="180"></el-table-column>
                        </el-table>
                    </template>
            </el-main>
        </el-container>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <el-container>
            <el-aside>
                <el-tree :data="storeCategoryTree"  @node-click="treeClick"></el-tree>
            </el-aside>
            <el-main>
                <div class="panel-heading">{{title}}</div>
                <form class="form-horizontal">
                    <div class="form-group">
                        <div class="col-sm-2 control-label">产品id</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control input-sm" v-model="storeProductPrice.productId" placeholder="产品id"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">商户id</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control input-sm" v-model="storeProductPrice.sellerId" placeholder="商户id"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">价格</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control input-sm" v-model="storeProductPrice.price" placeholder="价格"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">阶梯价</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control input-sm" v-model="storeProductPrice.stepPrice" placeholder="阶梯价"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">备注</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control input-sm" v-model="storeProductPrice.marks" placeholder="备注"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">更新人</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control input-sm" v-model="storeProductPrice.updateName" placeholder="更新人"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">更新时间</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control input-sm" v-model="storeProductPrice.updateTime" placeholder="更新时间"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">伪删除标记（0正常 1删除）</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control input-sm" v-model="storeProductPrice.delete" placeholder="伪删除标记（0正常 1删除）"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">创建人</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control input-sm" v-model="storeProductPrice.createName" placeholder="创建人"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">创建时间</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control input-sm" v-model="storeProductPrice.createTime" placeholder="创建时间"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label"></div>
                        <input type="button" class="btn btn-primary  btn-sm" @click="saveOrUpdate" value="确定"/>&nbsp;&nbsp;
                        <input type="button" class="btn btn-warning  btn-sm" @click="reload" value="返回"/>
                    </div>
                </form>

            </el-main>
        </el-container>
    </div>
    <!-- 商品三级分类选择 -->
    <el-dialog title="商品三级分类选择" :visible.sync="goodsCategoryDialogVisible" width="40%">
        <div class="el-form-item">
            <label class="el-form-item__label" style="width: 80px;">商品分类</label>
            <div class="el-form-item__content" style="margin-left: 80px;">
                <el-cascader style="width: 90%" filterable
                             v-model="categoryId"
                             :options="storeCategoryTree"
                             @change="categoryChange">
                </el-cascader>
            </div>
        </div>
    </el-dialog>
    <!-- 设置价格 -->
    <el-dialog title="提示" :visible.sync="priceDialog" width="50%" @close="closePriceDialog">
        <input v-model="tableIndex" hidden/>
        <!--<div class="form-group" style="display:none">-->
            <!--<div class="col-sm-2 control-label">产品价格:</div>-->
            <!--<div class="col-sm-2">-->
                <!--<input class="form-control" style="width: 80px;" v-model="priceInput" placeholder="请输入产品价格">-->
            <!--</div>-->
        <!--</div>-->
        <!--<el-row :gutter="20">-->
            <!--<el-col :span="4"><div>产品价格:</div></el-col>-->
            <!--<el-col :span="4"><div><input class="form-control" style="width: 80px;" v-model="priceInput" placeholder="请输入产品价格"></div></el-col>-->
            <!--<el-col :span="4"><div>起步价:</div></el-col>-->
            <!--<el-col :span="4"><div><input class="form-control" style="width: 200px;" v-model="startPriceInput" placeholder="请输入起步价"></div></el-col>-->
            <!--<el-col :span="4"><div>备注:</div></el-col>-->
            <!--<el-col :span="4"><div><input class="form-control" style="width: 200px;" v-model="marksInput" placeholder="请输入备注"></div></el-col>-->
        <!--</el-row>-->
        <!--<div class="form-group">-->
            <!--<div class="form-inline">产品价格:<input class="form-control" style="width: 80px;" v-model="priceInput" placeholder="请输入产品价格"></div>-->
            <!--<div class="form-inline">起步价:<input class="form-control" style="width: 200px;" v-model="startPriceInput" placeholder="请输入起步价"></div>-->
            <!--<div class="form-inline">备注:<input class="form-control" style="width: 200px;" v-model="marksInput" placeholder="请输入备注"></div>-->
        <!--</div>-->
        <el-form :inline="true"  class="demo-form-inline">
            <el-form-item label="产品价格">
                <el-input v-model="priceInput" type="number" min="0" placeholder="请输入产品价格"></el-input>
            </el-form-item>
            <el-form-item label="起步价">
                <el-input v-model="startPriceInput" type="number" min="0" placeholder="请输入起步价"></el-input>
            </el-form-item>
            <el-form-item label="备注">
                <el-input v-model="marksInput" placeholder="请输入备注"></el-input>
            </el-form-item>
        </el-form>
        <el-table :data="stepPriceList" width="90%" stripe  style="width: 100%">
            <el-table-column   label="起始数量" width="180">
                <template slot-scope="scope">
                    <el-input v-model="scope.row.minSum" type="number" min="0" placeholder="请输入"></el-input>
                </template>
            </el-table-column>
            <el-table-column label="结束数量" width="180">
                <template slot-scope="scope">
                    <el-input v-model="scope.row.maxSum" type="number" min="0" placeholder="请输入"></el-input>
                </template>
            </el-table-column>
            <el-table-column label="价格" width="180">
                <template slot-scope="scope">
                    <el-input v-model="scope.row.price" type="number" min="0" placeholder="请输入"></el-input>
                </template>
            </el-table-column>
            <!--<el-table-column label="说明" width="180">-->
                <!--<template slot-scope="scope">-->
                    <!--<el-input v-model="scope.row.explain" placeholder="请输入"></el-input>-->
                <!--</template>-->
            <!--</el-table-column>-->
            <el-table-column label="操作">
                <template slot-scope="scope">
                    <el-button
                            @click.native.prevent="delRow(scope.$index, stepPriceList)"
                            type="text"
                            size="small">
                        移除
                    </el-button>
                </template>
            </el-table-column>
        </el-table>
        <input type="button" class="btn btn-primary  btn-sm" @click="addStepPriceList" value="添加阶梯价行"/>
        <span slot="footer" class="dialog-footer">
        <el-button @click="priceDialog = false">取 消</el-button>
        <el-button type="primary" @click="savePrice">确 定</el-button>
      </span>
    </el-dialog>
</div>

<script src="${request.contextPath}/statics/js/modules/storeProductPrice/storeproductprice.js?_${.now?long}"></script>
</body>
</html>